package com.compass.framework.model

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

/**
 * Description： 用户信息
 */

@Parcelize
data class User(
    var id: String,
    var createTime: String?,//创建时间
    var mobile: String,//手机号
    var alternativeMobile: String,//备用手机号//移动座机
    var accId: String,//环信账号
    var avatar: String?,//头像
    var name: String,//真实名字
    var sex: Int?,//用户性别
    var hospitalName: String?,//医院名称
    var onlineStatus: Int=0,//0是空闲 1是忙碌
    var authentication: Int,//是否认证  1是认证
    var prescriptionAllow: Int?=0,//是否可开处方  1是开启
    var consultationAllow: Int?=0,//问诊权限  1是开启
    var hospitalizedAllow: Int?=0,//住院权限  1是开启
    var examinationAllow: Int?=0,//检验检查  1是开启
    var auditPrescriptionAllow: Int?=0,//审方权限  1是开启
    var auditStatus: Int?=0,// 0待审核    1审核中    2已通过  -1已拒绝
    var auditReason:String?="",
    var introduce: String?,
    var hospitalLevel: String?,//医院等级
    var departmentName: String?,//科室名称
    var positionName: String?,//职称名称
    var meritIllness: String?,//擅长疾病
    var meritTherapeutic: String?,//擅长治疗
    var signFile: String?,//CA签名
    var wyyxUser: MeetingUser?,//会议账号信息
    val config: ConsultSetting?,
    val statistics: Statistics,
    var appHospitalConfigRespVO:AppHospitalConfig?
) : Parcelable {
    fun getSexString(): String {
        return when (sex) {
            1 -> {
                "男"
            }

            2 -> {
                "女"
            }

            else -> {
                "未知"
            }
        }
    }

    fun getNameString(): String {
       if (name.isNullOrEmpty()){
           return "未知"
       }
        return name
    }

    fun getHospitalNameString(): String? {
        if (hospitalName.isNullOrEmpty()){
            return "暂未设置归属医院"
        }
        return hospitalName

    }

    fun getDepartmentNameString(): String? {
        if (departmentName.isNullOrEmpty()){
            return "暂未设置"
        }
        return departmentName
    }

    fun getPositionNameString(): String? {
        if (positionName.isNullOrEmpty()){
            return "暂未设置"
        }
        return positionName
    }

    fun getIntroduceString(): String {
        introduce?.let {
            return it
        }?:kotlin.run {

            return "暂未填写"
        }
    }
}


@Parcelize
data class MeetingUser(
    var userUuid: String?,//会议账号
    var userToken: String,//会议token
    var privateMeetingNum: String,//会议token
    var shortMeetingNum: String,//会议token
    var nickname: String,//会议token
    var accId: String,//Im账号
    var token: String,//ImToken
) : Parcelable


@Parcelize
data class Statistics(
    var consultationNum: String?,
    var favorableRate: String,
    var followersNum: String

) : Parcelable


/**
 * Description： 医院配置
 * Date:2024/4/22 16:59
 */
@Parcelize
data class AppHospitalConfig(
    val isFollowUp: String, //是否验证复诊  1为是
    val isAllowGive: String, //是否允许赠送  1为是
    val giveTime: String, //医生赠送限制时长(小时)
    val giveRow: String, //医生赠送限制条数
    val isSelfUpDateFee: String, //是否支持医生自行修改问诊资费  1为是
    val isAllowReferral: String, //是否支持转诊  1为是
    val isSupportNewOrder: String, //是否支持添加耗材订单  1为是
    val geographicalLocation: String, //医护修改状态时是否验证地理位置，如开启验证选择范围（米） 1为是
    val verificationScope: String, ///验证范围
    val alarmCall: String, //报警电话
    val inspectionPacs: String, //影响检查报告
): Parcelable


@Parcelize
data class DoctorCode(
    var doctorId: String?,
    var version: String,
    var qrCode: String

): Parcelable

@Parcelize
data class AuthInfo(
    var doctorSex :Int,
    var idCardPositive :String,
    var doctorName :String,
    var idCardReverse:String,
    var licensedPositive:String,
    var licensedReverse:String
):Parcelable{
    fun getSexString(): String {
        return when (doctorSex) {
            1 -> {
                "男"
            }

            2 -> {
                "女"
            }

            else -> {
                "未知"
            }
        }
    }
}